Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add stats videojs plugin #3958

Merged
merged 2 commits into from
Apr 28, 2021
Merged

Conversation

rigelk
Copy link
Collaborator

@rigelk rigelk commented Apr 13, 2021

Description

This PR adds a "stats for nerds" panel, like YouTube provides, minus a few things: no mystery text, no exposure of an optimal resolution, no loudness normalization (we don't have that yet), no fancy graphs (yet).

It serves as a good debug tool for advanced users, where we could move some of the information we currently display in the bar (like p2p traffic) - taking precious space.

Related issues

closes #1788

Has this been tested?

  • 👍 yes, light tests as follows are enough

TODO:

  • cleanup metadata fetching
  • test with:
    • Webtorrent videos
    • HLS videos
    • live videos
    • embeds

Screenshots

Don't mind the fluffy cat 😉

Screenshot_2021-04-13
Screenshot_2021-04-13

@rigelk rigelk added UI non-trivial UI changes, that might need discussion Component: Player ⏯️ labels Apr 13, 2021
@rigelk rigelk force-pushed the stats-for-nerds branch 2 times, most recently from 22faed0 to 0af362b Compare April 15, 2021 11:05
Comment on lines 159 to 166
if (this.source === 'webtorrent') {
const progress = this.player_.webtorrent().getTorrent()?.progress
const videoFile = this.player_.webtorrent().getCurrentVideoFile()
videoFile.metadata = metadata[videoFile.fileUrl] = videoFile.metadata || metadata[videoFile.fileUrl] || videoFile.metadataUrl && await fetch(videoFile.metadataUrl).then(res => res.json())
this.list.innerHTML = getListTemplate(this.options_, this.player_, { playerNetworkInfo: this.playerNetworkInfo, videoFile, progress })
} else {
this.list.innerHTML = getListTemplate(this.options_, this.player_, { playerNetworkInfo: this.playerNetworkInfo })
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Chocobozzz I'm wondering how to get the current progress of buffered data, and more importantly the current video file in the case of p2p-media-loader use; I searched through the code, to no avail 😢

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to give the ability to provide the hlsjs object in the p2p-media-loader-plugin.ts so you can get it here and use all available information

@Chocobozzz Chocobozzz marked this pull request as ready for review April 27, 2021 13:53
@Chocobozzz Chocobozzz merged commit 4e11d8f into Chocobozzz:develop Apr 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Player ⏯️ UI non-trivial UI changes, that might need discussion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Statistics in player
2 participants